/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.uccart_project.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author KNO
 */
@Entity
@Table(name = "usuario")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u"),
    @NamedQuery(name = "Usuario.findByUsId", query = "SELECT u FROM Usuario u WHERE u.usId = :usId"),
    @NamedQuery(name = "Usuario.findByUsPw", query = "SELECT u FROM Usuario u WHERE u.usPw = :usPw"),
    @NamedQuery(name = "Usuario.findByUsNombre", query = "SELECT u FROM Usuario u WHERE u.usNombre = :usNombre"),
    @NamedQuery(name = "Usuario.findByUsTipo", query = "SELECT u FROM Usuario u WHERE u.usTipo = :usTipo"),
    @NamedQuery(name = "Usuario.UpDateByUsId", query = "UPDATE Usuario   u SET u.usPw = :usPw, u.usNombre = :usNombre, u.usTipo = :usTipo  WHERE u.usId = :usId")})
public class Usuario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "us_id")
    private String usId;
    @Column(name = "us_pw")
    private String usPw;
    @Column(name = "us_nombre")
    private String usNombre;
    @Column(name = "us_tipo")
    private Integer usTipo;

    public Usuario() {
    }

    public Usuario(String usId) {
        this.usId = usId;
    }

    public String getUsId() {
        return usId;
    }

    public void setUsId(String usId) {
        this.usId = usId;
    }

    public String getUsPw() {
        return usPw;
    }

    public void setUsPw(String usPw) {
        this.usPw = usPw;
    }

    public String getUsNombre() {
        return usNombre;
    }

    public void setUsNombre(String usNombre) {
        this.usNombre = usNombre;
    }

    public Integer getUsTipo() {
        return usTipo;
    }

    public void setUsTipo(Integer usTipo) {
        this.usTipo = usTipo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (usId != null ? usId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usuario)) {
            return false;
        }
        Usuario other = (Usuario) object;
        if ((this.usId == null && other.usId != null) || (this.usId != null && !this.usId.equals(other.usId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.uccart_project.model.Usuario[ usId=" + usId + " ]";
    }
    
}
